package com.test.spring.properties;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import javax.sql.DataSource;
import java.sql.SQLException;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2018/9/25 20:59
 */
public class Main {
    public static void main(String[] args) throws SQLException {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("beans-properties.xml");
        DataSource dataSource = ctx.getBean("dataSource", DataSource.class);

        System.out.println(dataSource.getConnection());
    }
}
